package org.fitz.controller;

import lombok.extern.slf4j.Slf4j;
import org.fitz.controller.frontend.MainPageController;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Slf4j
@WebServlet("/")
public class DispatchServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String requestPath = req.getServletPath();
        String requestMethod = req.getMethod();
        System.out.println("请求路径是:"+requestPath);
        System.out.println("请求方法是:"+requestMethod);
        if ("/main/getMainPageInfo".equals(requestPath)&&requestMethod.equals("GET")){
            new MainPageController().getMainPageInfo(req,resp);
        }
    }
}
